package org.third.integration.hibernate;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;

import org.postgresql.Driver;

public class PostgresSQLTest {
    public static void main(String[] args) {
        org.postgresql.Driver d = new Driver();
        Connection c = null;
        try {
            c = DriverManager.getConnection("jdbc:postgresql://16.187.189.77:5432/idm-gongyo", "postgres", "postgres");
            java.sql.Statement stmt = c.createStatement();
            ResultSet rs = stmt.executeQuery("select 12");
            while(rs.next()){
                System.out.println(rs.getString(1));
            }

        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            if (null != c) {
                try {
                    c.close();
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            }
        }
    }

}
